package com.satis.compose.get.example.pages

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import com.satis.compose.get.annotation.PageRoute
import com.satis.compose.get.example.R
import com.satis.compose.get.widget.GetImage
import com.satis.compose.get.widget.GetPage

/**
 * @author sunshaobei on 2023/4/2
 */
@PageRoute(route = "/app/image")
@Composable
fun ImagePage() {
    GetPage() {
        LazyColumn(modifier = Modifier
            .statusBarsPadding()
            .fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally){
            item {
                Text(text = "res资源图片显示")
            }
            item {
                Image(
                    painter = painterResource(id = R.drawable.wechat),
                    contentDescription = null
                )
            }
            item {
                Text(text = "GetImage 加载res图片")
            }
            item { 
                GetImage(resId = R.drawable.wechat)
            }
            item {
                Text(text = "GetImage 加载网络图片")
            }
            item {
                GetImage(url = "https://t7.baidu.com/it/u=1595072465,3644073269&fm=193&f=GIF")
            }
        }
    }
}